<?php
/**
 * Created by PhpStorm.
 * User: wangsong
 * Time: 2018/5/30 17:40
 */

namespace App\Project\Image;

class Path
{
    protected $attribute;

    /**
     * Path constructor.
     * @param $attribute
     */
    public function __construct($attribute)
    {
        $this->attribute = $attribute;
    }

    public function attribute()
    {
        return $this->attribute;
    }

    public function src()
    {
        return new Src(\Storage::url($this->attribute));
    }

    public function delete()
    {
        \File::delete(storage_path('app/' . $this->attribute));
    }
}